<template>
  <!-- 头部搜索部分 -->
  <div class="g-layout-header-userHandl">
    <!-- 左头像 -->
    <div class="headLeft">
      <div class="headLeft-box">
        <img id="headLeftImg" src="../../assets/logo.png" alt="" />
      </div>
    </div>
    <!-- 中间搜索 -->
    <div class="searchTitle">
      <van-search class="searchInp" shape="round" placeholder="请输入搜索关键词" @focus="handleSearch" />
    </div>
    <!-- 右边邮件 -->
    <div class="headRight">
      <img id="headRightImg" src="../../assets/icon-img/youjian.png" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    // 搜索关键字
    keyword: {
      type: String
    }
  },
  setup() {
    // 搜索的方法
    const handleSearch = () => {
      console.log(11111)
    }
    return {
      handleSearch
    }
  }
}
</script>

<style lang="scss" scoped>
// 头部搜索
.g-layout-header-userHandl {
  display: flex;
  justify-content: center;
  align-items: center;
  // 左边头像icon
  .headLeft {
    flex: 1;
    .headLeft-box {
      border-radius: 100%;
      width: 35px;
      height: 35px;
      margin-left: 10px;
      overflow: hidden;
      #headLeftImg {
        width: 100%;
      }
    }
  }
  // 中间搜索
  .searchTitle {
    flex: 7;
  }
  .headRight {
    flex: 1;
    // icon邮件
    #headRightImg {
      width: 25px;
    }
  }
}
</style>
